#include "stm32f10x.h"
#include "Delay.h"
#include "OLED.h"
#include "DS1307.h"

#define DATE_LINE 2
#define TIME_LINE 4

int main(void)
{
	OLED_Init();
	DS1307_init();
	
	//OLED_ShowChar(1, 1, 'A');
	OLED_ShowString(TIME_LINE - 1, 1, "Time:");
	OLED_ShowString(1, 1, "Date:");
    while(1)
    {
		DS1207_TEXT();
		OLED_ShowNum(DATE_LINE, 1, tempdata[0], 2);
		OLED_ShowChar(DATE_LINE, 3, '-');
		OLED_ShowNum(DATE_LINE, 4, tempdata[1], 2);
		OLED_ShowChar(DATE_LINE, 6, '-');
		OLED_ShowNum(DATE_LINE, 7, tempdata[2], 2);
		
		OLED_ShowNum(TIME_LINE, 1, tempdata[3], 2);
		OLED_ShowChar(TIME_LINE, 3, ':');
		OLED_ShowNum(TIME_LINE, 4, tempdata[4], 2);
		OLED_ShowChar(TIME_LINE, 6, ':');
		OLED_ShowNum(TIME_LINE, 7, tempdata[5], 2);
		delay_ms(500);
    }
}
